-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Level Events] manage level events registration mask #13787
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a really interesting and promising change. Here are some initial thoughts.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have a look at your //test/... compilation errors, but otherwise this is looking extremely promising, some tests we enabled which appear to no longer be flaky_on_windows...
//test/extensions/filters/http/ratelimit:ratelimit_integration_test PASSED in 30.7s
//test/extensions/stats_sinks/metrics_service:metrics_service_integration_test PASSED in 8.3s
//test/integration:http_subset_lb_integration_test PASSED in 8.9s
//test/integration:tcp_tunneling_integration_test PASSED in 18.3s
//test/integration:websocket_integration_test PASSED in 11.8s
//test/integration:hds_integration_test PASSED in 33.8s
Stats over 2 runs: max = 33.8s, min = 32.9s, avg = 33.4s, dev = 0.4s
//test/integration:idle_timeout_integration_test PASSED in 41.4s
Stats over 2 runs: max = 41.4s, min = 40.8s, avg = 41.1s, dev = 0.3s
//test/integration:http2_integration_test PASSED in 17.4s
Stats over 4 runs: max = 17.4s, min = 12.9s, avg = 14.9s, dev = 1.7s
//test/integration:protocol_integration_test PASSED in 45.3s
Stats over 5 runs: max = 45.3s, min = 34.6s, avg = 39.9s, dev = 3.6s
@wrowe I am trying to change the implementation to move the registration/unregistration logic to the In terms of testing I think I will try to do a CI run on Linux with |
@davinci26 have you considered transforming this logic:
into a macro or helper function etc? (could it be some case evaluation done using compiler defines so theres not so many if checks/use constexpr if? also so we don't have to rewrite it many times and can avoid copy/paste errors) is this part of the logic you are looking to move closer to the file event impl or just the bits around setting the event mask:
|
@sunjayBhatia I have changed this locally but I need to do some more changes in my new implementation. |
@antoniovicente I addressed all your comments and added the |
I still need to work through some changes in the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still need to work through some changes in the
ssl_socket
, I dont think we handle well the case wereEAWOULDBLOCK
is the error during the handshake.
Can you do a master merge to pick up #13772 ?
d6eca0e
to
588fff8
Compare
include/envoy/event/file_event.h
Outdated
@@ -18,15 +18,28 @@ struct FileReadyType { | |||
static const uint32_t Closed = 0x4; | |||
}; | |||
|
|||
enum class FileTriggerType { Level, Edge }; | |||
#define FORCE_LEVEL_EVENTS 0 | |||
enum class FileTriggerType { Level, Edge, EmulatedEdge }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get rid of Level now? Windows is the only platform its needed and we fully intend to use the "optimized" flavor anyhow. Or are you using it for testing/comparison?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Level events are used by listeners and DNS ( on all platforms), so we cant really remove it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah I did not know that. Have you played with trying to move listeners and DNS to EmulatedEdge? Just curious. This is something that can certainly be done later if there is interest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some comments now above each trigger type with what they do and what they are used for? I think now it's less clear what all of these do and are for and it would be good to have a comment trail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a block of comments for EmulatedEdge
and some comments with the current use cases of the other event types
@antoniovicente ready for a review. The changes I made are:
|
Remove |
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's it. Change looks great except for the minor comments below.
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Off to @envoyproxy/senior-maintainers for final review.
Awesome improvement to event handling on Windows. Some further refinements would be good but it's better to tackle them over time. Do share with me performance data and plans for further improvements.
Thank you for structuring the change so it is minimally intrusive on other platforms while also allowing compile time defines to opt into this mode for debugging.
@envoyproxy/senior-maintainers note that because the change is guarded with This code is impossible to test on POSIX unless:
Let me know what you think and I will implement it! |
I would suggest you adjust the coverage expectations. Some low level tests that cover basic adjustments to the event mask after events are delivered and after readv calls that block would be good to have when emulated edge is enabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very clever. Nice work! Just some small comments. I agree with @antoniovicente about changing coverage expectations. I suppose one option would be to have some test under coverage that is compiled a 2nd time with the force enable flag for the feature? I'm not sure how hard that would be. Thank you!
/wait
include/envoy/event/file_event.h
Outdated
@@ -18,15 +18,28 @@ struct FileReadyType { | |||
static const uint32_t Closed = 0x4; | |||
}; | |||
|
|||
enum class FileTriggerType { Level, Edge }; | |||
#define FORCE_LEVEL_EVENTS 0 | |||
enum class FileTriggerType { Level, Edge, EmulatedEdge }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add some comments now above each trigger type with what they do and what they are used for? I think now it's less clear what all of these do and are for and it would be good to have a comment trail.
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Waiting for CI to finish.
I'm very glad we got to the end of this awesome improvement.
@antoniovicente thanks a ton for the reviews and all the help with landing this! Your help was really crucial. @envoyproxy/senior-maintainers thanks for your support to make Envoy cross platform. |
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com>
Signed-off-by: Sotiris Nanopoulos <sonanopo@microsoft.com> Signed-off-by: Qin Qin <qqin@google.com>
Signed-off-by: Sotiris Nanopoulos sonanopo@microsoft.com
Fixes: #13189
In this PR we introduce
FileTriggerType::EmulatedEdge
which are level events that behave similarly to edge events. We achieve this behavior in the following way:With this change, we manage to enable the remaining failing tests on Windows.
Additional Description:
We expect to have roughly the same performance on Windows and on Linux.
Risk Level: Low (Windows Only)
Testing: Existing tests
Docs Changes: N/A
Release Notes: N/A
Platform Specific Features: N/A